<template>
	<el-card class="form-container">
		<el-form :model="editForm" ref="editForm" :rules="dataRule" @keyup.enter.native="dataFormSubmitHandle()" label-width="90px">
			<el-form-item label="sku名称" prop="skuName">
				<el-input v-model="editForm.skuName" placeholder="请输入sku名称"></el-input>
			</el-form-item>
			<el-form-item label="商品价格" prop="goodsPrice">
				<el-input v-model="editForm.goodsPrice" placeholder="请输入商品价格"></el-input>
			</el-form-item>
			<el-form-item label="库存数量" prop="stockNum">
				<el-input v-model="editForm.stockNum" placeholder="请输入库存数量"></el-input>
			</el-form-item>
			<el-form-item label="预警库存数量" prop="alertStockNum">
				<el-input v-model="editForm.alertStockNum" placeholder="请输入预警库存数量"></el-input>
			</el-form-item>
			<el-form-item label="商品主图" prop="masterImage">
				<el-input v-model="editForm.masterImage" placeholder="请输入商品主图"></el-input>
			</el-form-item>
			<el-form-item label="图片列表：轮播图" prop="rotateImageList">
				<el-input v-model="editForm.rotateImageList" placeholder="请输入图片列表：轮播图"></el-input>
			</el-form-item>
			<el-form-item label="商品重量(克)" prop="goodsWeight">
				<el-input v-model="editForm.goodsWeight" placeholder="请输入商品重量(克)"></el-input>
			</el-form-item>
			<el-form-item label="spu编号" prop="spuCode">
				<el-input v-model="editForm.spuCode" placeholder="请输入spu编号"></el-input>
			</el-form-item>
			<el-form-item label="商品分类编号" prop="categoryCode">
				<el-input v-model="editForm.categoryCode" placeholder="请输入商品分类编号"></el-input>
			</el-form-item>
			<el-form-item label="类目名称" prop="categoryName">
				<el-input v-model="editForm.categoryName" placeholder="请输入类目名称"></el-input>
			</el-form-item>
			<el-form-item label="品牌名称" prop="brandName">
				<el-input v-model="editForm.brandName" placeholder="请输入品牌名称"></el-input>
			</el-form-item>
			<el-form-item label="商品规格" prop="goodsSpec">
				<el-input v-model="editForm.goodsSpec" placeholder="请输入商品规格"></el-input>
			</el-form-item>
			<el-form-item label="商品销量" prop="salesVolume">
				<el-input v-model="editForm.salesVolume" placeholder="请输入商品销量"></el-input>
			</el-form-item>
			<el-form-item label="商品评论量" prop="commentVolume">
				<el-input v-model="editForm.commentVolume" placeholder="请输入商品评论量"></el-input>
			</el-form-item>
			<el-form-item label="商品状态 1.正常 2.下架 3.删除" prop="goodsStatus">
				<el-input v-model="editForm.goodsStatus" placeholder="请输入商品状态 1.正常 2.下架 3.删除"></el-input>
			</el-form-item>
			<el-form-item label="创建时间" prop="createTime">
				<el-input v-model="editForm.createTime" placeholder="请输入创建时间"></el-input>
			</el-form-item>
			<el-form-item label="修改时间" prop="updateTime">
				<el-input v-model="editForm.updateTime" placeholder="请输入修改时间"></el-input>
			</el-form-item>
			<el-form-item label="商品条码" prop="goodsBarCode">
				<el-input v-model="editForm.goodsBarCode" placeholder="请输入商品条码"></el-input>
			</el-form-item>
			<el-form-item label="" prop="skuCode">
				<el-input v-model="editForm.skuCode" placeholder="请输入"></el-input>
			</el-form-item>
			<el-form-item>
				<el-button @click="cancel">取消</el-button>
				<el-button type="primary" @click="submit('dataForm')">确定</el-button>
			</el-form-item>
		</el-form>
	</el-card>
</template>

<script>
	import { findGoodsSkuDetail } from '@/api/mall/goodsSku'
	export default {
		name: 'user-goodsSku',
		data() {
			return {
				editForm: {
					id:'',
					skuName: '',
					goodsPrice: '',
					stockNum: '',
					alertStockNum: '',
					masterImage: '',
					rotateImageList: '',
					goodsWeight: '',
					spuCode: '',
					categoryCode: '',
					categoryName: '',
					brandName: '',
					goodsSpec: '',
					salesVolume: '',
					commentVolume: '',
					goodsStatus: '',
					createTime: '',
					updateTime: '',
					goodsBarCode: '',
					skuCode: '',
				}
			}
		},
		created() {
			this.editForm.id = this.$route.query.id
			this.view(this.$route.query.id)
		},
		methods: {
			view(val) {
				findGoodsSkuDetail(val).then(res => {
					this.editForm = res.data.responseData
				})
			},
			cancel() {
				this.$router.go(-1)
			},
			update() {

			}
		}
	}
</script>

<style>
</style>
